import { post, get, put, Delete, form } from "@/axios/http.js";
import { basicApi } from "@/api/index.js"
// 相册管理
export default {
    namespaced: true,
    state: {},
    actions: {
        // 相册-照片-点赞/取消点赞
        photoGive({}, params) {
            return put(basicApi.photoalbum.photoGive, params).then(res => {
                if (res.data.code == 200) {
                    console.log(res)
                    return res.data.result
                } else {
                    return res
                        //  this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 相册-照片-点赞/取消点赞
        photoGive1({}, params) {
            return put(basicApi.photoalbum.photoGive, params).then(res => {
                if (res.data.code == 200) {
                    return res
                } else {
                    return res
                        //  this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 相片评论列表
        pictrureComment({}, params) {
            return post(basicApi.photoalbum.pictrureComment, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 相片转发列表
        pictrureForward({}, params) {
            return post(basicApi.photoalbum.pictrureForward, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 相片点赞列表
        pictrureGive({}, params) {
            return post(basicApi.photoalbum.pictrureGive, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 权限设置
        permission({ commit }, params) {
            return put(basicApi.photoalbum.permission, params).then(res => {
                return res
            });
        },
        // 移动相片信息
        albumPhotoMove({ commit }, params) {
            return put(basicApi.photoalbum.albumPhotoMove, params).then(res => {
                return res
            });
        },
        // 编辑相片信息
        updatePicture({ commit }, params) {
            return put(basicApi.photoalbum.updatePicture, params).then(res => {
                return res
            });
        },
        // 转载好友相册的图片
        albumReprintFriends({ commit }, params) {
            return get(basicApi.photoalbum.albumReprintFriends, params).then(res => {
                if (res.data.code == 200) {
                    return res
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 相片转发
        photoForwardO({ commit }, params) {
            return post(basicApi.photoalbum.photoForwardO, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.msg
                } else {
                    this._vm.$message.error(res.data.msg)
                    return null
                }
            });
        },
        // 分页查询相册列表-学校
        albumPageSchool({ commit }, params) {
            return post(basicApi.photoalbum.albumPageSchool, params).then(res => {
                return res
            });
        },
        // 新建相册-学校班级教研共用
        pictureAlbumSchool({ commit }, params) {
            return post(basicApi.photoalbum.pictureSchool, params).then(res => {
                return res
            });
        },
        // 新建相册-学校班级教研共用
        albumCreateSchool({ commit }, params) {
            return post(basicApi.photoalbum.albumCreateSchool, params).then(res => {
                return res
            });
        },
        // 学校主页，相片列表
        pictureSchool({ commit }, params) {
            return post(basicApi.photoalbum.pictureSchool, params).then(res => {
                return res
            });
        },
        // 相册总的访问列表
        albumVisitorPage({ commit }, params) {
            return post(basicApi.photoalbum.albumVisitorPage, params).then(res => {
                return res
            });
        },
        // 编辑相册
        updatePhotoalbum({ commit }, params) {
            return post(basicApi.photoalbum.updatePhotoalbum, params).then(res => {
                return res
            });
        },
        // 设置封面
        settingCoverPhotoalbum({ commit }, params) {
            return get(basicApi.photoalbum.settingCoverPhotoalbum, params).then(res => {
                return res
            });
        },
        // 删除相册
        removePhotoalbum({ commit }, params) {
            return Delete(basicApi.photoalbum.removePhotoalbum, params).then(res => {
                return res
            });
        },
        // 上传相片
        photoUpImgs({ commit }, params) {
            return post(basicApi.photoalbum.photoUpImgs, params).then(res => {
                return res
            });
        },
        // 权限设置
        permissionPhotoalbum({ commit }, params) {
            return get(basicApi.photoalbum.permissionPhotoalbum, params).then(res => {
                return res
            });
        },
        // 分页查询相片列表
        pagePictureslist({ commit }, params) {
            return post(basicApi.photoalbum.pagePictureslist, params).then(res => {
                return res
            });
        },
        // 新建相册
        addPhotoalbum({ commit }, params) {
            return post(basicApi.photoalbum.addPhotoalbum, params).then(res => {
                return res
            });
        },
        // 批量删除相片
        batchDeletePicture({ commit }, params) {
            return Delete(basicApi.photoalbum.batchDeletePicture, params).then(res => {
                return res
            });
        },
        // 分页查询相册列表-好友相册
        albumPageFriend({ commit }, params) {
            return post(basicApi.photoalbum.albumPageFriend, params).then(res => {
                return res
            });
        },
        // 分页查询相册列表
        pagePhotoalbumlist({ commit }, params) {
            return post(basicApi.photoalbum.pagePhotoalbumlist, params).then(res => {
                return res
            });
        },
    },
    mutations: {},
};